package com.group3.Feign;

import com.group3.config.FeignConfiguration;
import com.group3.fallback.payment.PaymentServiceFallback;
import com.group3.model.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@FeignClient(value = "ls-service-payment",
        configuration = FeignConfiguration.class,
        fallback = PaymentServiceFallback.class) // 添加FeignClient注解指定服务名称
public interface PaymentSeviceFeign {
    @GetMapping("/payment/getPaymentList")
    List<Payment> getPaymentList();

    @GetMapping("/payment/getPaymentById/{id}")
    Payment getPaymentById(@PathVariable Integer id);

    @GetMapping("/payment/getPaymentByOid/{oid}")
    Payment getPaymentByOid(@PathVariable Integer oid);

    @RequestMapping("/payment/paymentOrder/{oid}") //
    Payment paymentOrder(@PathVariable  Integer oid);

    @GetMapping("/payment/refundOrder/{oid}")
    boolean refundOrder(@PathVariable Integer oid);

    @GetMapping("/payment/initiateRefund/{oid}")
    boolean initiateRefund(@PathVariable Integer oid);

}
